<?php
// +----------------------------------------------------------------------
// | ManniuRead
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://manniuyun.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: heitao <read@manniuyun.com>
// +----------------------------------------------------------------------

namespace manniu\controller;

class FrontBase extends Base{
    /**
     * TP初始化方法
     * @access public
     */
    public function _initialize(){
    	parent::_initialize();
        // 如果当前是后台入口文件访问前台，则强制跳转到前台入口文件
        if(defined('IS_ADMIN')){
            if($this->request->pathinfo() == '' || $this->request->pathinfo() == '/'){
                $this->redirect('admin/index/index');
            }else{
                $this->redirect($this->request->domain().'/'.$this->request->pathinfo(),302);
            }
        }
    }
}
